﻿using Love;
using MyGrid.Core;
using MyGrid.Core.HexTypeA.Extensions;
using MyGrid.Core.HexTypeA.Visual;

namespace MyGrid.Test
{
    internal class Program : Scene
    {
        private List<MGVector2I> _list;

        public Program()
        {
            _list = new List<MGVector2I>();

            //var centerPoint = new MGVector2I(1, 1);
            //_list.Add(centerPoint);

            //_list.AddRange(centerPoint.GetRing(4));

            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    _list.Add(new MGVector2I(j, i));
                }
            }
        }

        public override void Draw()
        {
            var unitSize = 30;
            var zoom = 1f;
            foreach (var item in _list)
            {
                var i = item.X;
                var j = item.Y;

                var pos =HexTypeALocator
                      .GetVisualPosition(new Core.MGVector2I(i, j), unitSize, zoom, new Core.MGVector2F(-200, -200));

                Graphics.SetColor(Color.Aqua);
                Graphics.Ellipse(DrawMode.Fill, pos.X, pos.Y, 2, 2);
            }
        }

        static void Main(string[] args)
        {
            Boot.Run(new Program(), new BootConfig() { WindowX = -1000, WindowY = 100, WindowBorderless = false });
        }
    }
}
